
// 调用方法 removeObj(原数组对象,需要移除的对象数组);
export function removeObj(arrOrObj, keys) {
  let newObj='';
  if (Array.isArray(arrOrObj)){//数组
    arrOrObj.forEach((e,i)=>{
      getNewData(e, keys, data => {
        e = data
        if (i == arrOrObj.length - 1) {
          newObj= arrOrObj
        }
      })
    })

  }else{//对象
    getNewData(arrOrObj, keys,data=>{
      newObj= data
    })
  }
  return newObj
}


function getNewData(obj,keys,callback){
  keys.map(function (key) {
    delete obj[key]
  })
  callback(obj)
}